package applet.misc.item;

import java.awt.Component;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

public class EnableItemListener implements ItemListener
{
	private Component component;
	public Component component() { return component; }
	public void setComponent(Component component) { this.component = component; }
	
	private boolean enable;
	public boolean enable() { return enable; }
	public void setEnable(boolean enable) { this.enable = enable; }
	
	public EnableItemListener(Component component, boolean enable)
	{
		setComponent(component);
		setEnable(enable);
	}
	
	@Override public void itemStateChanged(ItemEvent e) { component.setEnabled(enable); }
}